<html>
    <head>
        <style>
            body {
                font-family: 'arial', serif;
            }
            img {
                image-rendering: pixelated;
            }
            table {
                table-layout: fixed;
                width: 100%;
                border-collapse: collapse;
            }
            table * {
                border: 1px solid black;
                /* This is important to avoid table broders being "cut" */
                page-break-inside: avoid;
            }
            .page-break-always {
                page-break-after: always;
            }
            .page-break-avoid {
                page-break-after: avoid;
            }
        </style>
    </head>
    <body>
        <div class="page-break-always">
          <h2>Page 1</h2>
          <p><strong>page-break-after</strong> is applied always</p>
        </div>

        <div class="page-break-always">
          <h2>Page 2</h2>
          <p><strong>page-break-after</strong> is applied always</p>
        </div>

        <div class="page-break-avoid">
          <h2>Page 3</h2>
          <p><strong>page-break-after</strong> is avoided</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
          <p>Lots of content</p>
        </div>

        <div>
          <h2>Page 4</h2>
          <table>
            <thead>
              <tr>
                <th>Breaking table cells</th>
                <th>Over pages</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
              <tr>
                <td>Cell A</td>
                <td>Cell B</td>
              </tr>
              <tr>
                <td colspan="2">Cell A + B</td>
              </tr>
            </tbody>
          </table>
        </div>
    </body>
</html>
